package ch03.test;

import net.sf.cglib.proxy.Enhancer;

public class GuestCglibProxyFactory {
    private static GuestMethodInterceptor callback=new GuestMethodInterceptor();

    public static <T> T create(Class<T> target){
        Enhancer enhancer=new Enhancer();
        enhancer.setCallback(callback);
        enhancer.setSuperclass(target);
        return (T) enhancer.create();
    }

}
